
<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <title>表格嵌套</title>
  <style>
    table{border:1px solid black;background-color:#6F6}
    #one{text-align:center;}

  </style>

  <script>
    function ff(){
      var a1=document.getElementById("aa").value;
      var a2=document.getElementById("bb").value;

      var a4;
      if(a1>0&&a1<=1000){
        alert("不用交税");
      }else if(a1>1000&&a1<=3000){
        a4=(a1-a2)*0.001;
        document.getElementById("cc").value=a4;
      }else{
        a4=(a1-a2)*0.005;
       document.getElementById("cc").value=a4;
      }
    }

    function gg(){
     document.getElementById("aa").value="";
     document.getElementById("bb").value="";

    }
  </script>



</head>
<body>
<table border="1px solid black">
  <tr><td id="one" colspan="2">个人所得税</td></tr>
  <tr><td>请输入你的月收入:</td><td><input type="text" id="aa"/>元</td></tr>
  <tr><td>请输入所得税起征额:</td><td><input type="text" id="bb" />元</td></tr>
  <tr><td>所得税:</td><td><input type="text" id="cc" />元</td></tr>
  <tr><td colspan="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="button" onClick="ff()" value="计算"/>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="button" value="重填" onClick="gg()">
  </td></tr>

</table>
</body>
</html>
